// -*-c#-*-
// License: New BSD License : http://www.opensource.org/licenses/bsd-license.php
//
// Copyright (c) 2008, Brothers In Arms/Burl Nyswonger
//
// See: BiaVote.uc for full License
// 
//@L

class BiaVoteMessage extends UTLocalMessage
    Config(BiaVote);

/* ------------------------------------------------------------------------- */

`include( BiaVote/Classes/BiaStdInc.uci );
`include( BiaVote/Classes/BiaVote.uci );

/* ------------------------------------------------------------------------- */


static function string GetString(
        optional int Switch,
        optional bool bPRI1HUD,
        optional PlayerReplicationInfo RelatedPRI_1,
        optional PlayerReplicationInfo RelatedPRI_2,
        optional Object OptionalObject
        )
{
    local BiaVoteDataStore DS;
    local UIProviderScriptFieldValue U;

    DS = class'BiaVote.BiaVoteDataClient'.static.GetDs();
    
    `BiaDbg("BiaVoteDataStore Reference : " $ DS );
    switch( Switch )
    {
        case EBiaVoteMessage_Voting:
            if( DS != None )
            {
                if( DS.GetFieldValue("VoteOnMessage", U, 0))
                {
                    return U.StringValue;
                }
            }
            return "Vote in progress, 'mutate biavote' to participate";
        case EBiaVoteMessage_KeyMapped:
            if( DS != None )
            {
                if( DS.GetFieldValue("VoteKeyMessage", U, 0))
                {
                    return( U.StringValue );
                }
            }
            return "Type 'mutate biavote' in the console to Vote";
    }
    return("");
}

defaultproperties
{
    bIsUnique=true
    DrawColor=(R=255,G=75,B=25,A=255)
    FontSize=2
    bBeep=true
    bIsConsoleMessage=false
    MessageArea=3
}